import Vue from 'vue'
import Find from '../views/find'
import My from '../views/My'
import VueRouter from 'vue-router'
import RanKing from '../views/ranking'
import Recommed from '../views/recommed'
import SongList from '../views/songlist'
import NotFound from '../views/NotFound'

Vue.use(VueRouter)
const router = new VueRouter({
    routes: [
        {
            path: '/',
            redirect: '/find'
        },
        {
            path: '/find',
            component: Find,
            children: [
                {
                    path: '/find/ranking',
                    component: RanKing
                },
                {
                    path: '/find/recommed',
                    component: Recommed
                },
                {
                    path: '/find/songlist',
                    component: SongList
                },
            ]
        },
        {
            path: '/my',
            component: My,
            name:'My',
            children: [
                {
                    path: '/my/ranking/:name',
                    component: RanKing
                },
                {
                    path: '/my/recommed',
                    component: Recommed
                },
                {
                    path: '/my/songlist',
                    component: SongList
                },
            ]
        },
        {
            path: '*',
            component: NotFound
        }
    ]
})
export default router